  <style>
  /* Restyle the h1 in the kb */
  .simple_form h1 {
    font-size: 160%;
    background-color: transparent;
  }
  </style>
  <% unless cloudinary_enabled? %>
  <script>
  var Helpy = Helpy || {};
  Helpy.sendFile = function(file, toSummernote) {
    var data;
    data = new FormData;
    data.append('image[file]', file);
    return $.ajax({
      data: data,
      type: 'POST',
      url: '/admin/images',
      cache: false,
      contentType: false,
      processData: false,
      success: function(data) {
        var img;
        img = document.createElement('IMG');
        img.src = data.url;
        img.setAttribute('id', data.image_id);
        return toSummernote.summernote("insertNode", img);
      }
    });
  };

  Helpy.deleteFile = function(image_id) {
    return $.ajax({
      type: 'DELETE',
      url: '/admin/images/' + image_id,
      cache: false,
      contentType: false,
      processData: false,
      success: function(data) {
        console.log("Deleting Image....");
      }
    });
  };
  </script>
  <% end %>

  <%= f.input :title, label: I18n.translate("activerecord.attributes.doc.title", locale: I18n.locale), value: @doc.read_translated_attribute(:title) %>
  <% if params[:lang] == "#{I18n.locale}" %>
    <%= f.input("category_id", collection: categories_collection, prompt: t(:select_category, default: 'Select Category'), label: I18n.translate("activerecord.attributes.doc.category_id", locale: I18n.locale), :input_html => { class: 'no-translate' })  %>
  <% else %>
    <%= f.hidden_field("category_id", value: @doc.category_id) %>
  <% end %>
  <%= f.input :body, as: :summernote %>
  <% unless params[:lang] == "#{I18n.locale}" || @doc.translations.where(locale: locale).count > 0 %>
  <script>
    $('.panel-body').html('');
  </script>
  <% end %>
  </body>
  <hr/>
  <% if cloudinary_enabled? %>
    <div class="doc-form-files">
      <h4 class="form-subhead"><%= t('upload_image') %>:</h4>
      <%= cl_image_upload_tag(:image_id) %>
    </div>
  <% end %>
  <hr/>
  <h4 class="form-subhead"><%= t('additional_settings', default: 'Additional Settings') %>:</h4>
  <% if ![1,2].include?(@doc.category_id)  %>
    <div class= "form_group no-translate">
      <label class="control-label" for="tag_list"><%= t('tags', default: 'Tags') %>: </label>
      <%= f.text_field :tag_list, value: @doc.tag_list.to_s, class: 'selectize form-control' %>
    </div>

    <%= f.input :meta_description, label: I18n.translate("activerecord.attributes.doc.meta_description", locale: I18n.locale), value: @doc.read_translated_attribute(:meta_description)  %>
    <%= f.input :title_tag, label: I18n.translate("activerecord.attributes.doc.title_tag", locale: I18n.locale), value: @doc.read_translated_attribute(:title_tag)  %>
    <%= f.input :keywords, label: I18n.translate("activerecord.attributes.doc.keywords", locale: I18n.locale), value: @doc.read_translated_attribute(:keywords)  %>
    <%= f.input(:front_page, class:'no-translate', inline: true, :label => I18n.translate("activerecord.attributes.doc.front_page", locale: I18n.locale, default: "Feature on front page?")) if params[:lang] == "#{I18n.locale}"  %>
    <%= f.input(:allow_comments, class:'no-translate', inline: true, :label => I18n.translate("activerecord.attributes.doc.allow_comments", locale: I18n.locale, default: "Allow Commenting")) if forums? and params[:lang] == "#{I18n.locale}"  %>
  <% end %>

  <%#= f.text_field :rank %>
  <hr/>
  <% if params[:lang] == "#{I18n.locale}" %>
    <div class= "form_group no-translate">
      <label class="control-label" for="doc_active"><%= t('status', default: 'Article Status') %>: </label>
      <%= f.collection_radio_buttons :active, [[true, t('published_content', default: "Published")] ,[false, t('draft_content', default: "Draft")]], :first, :last %>
    </div>
  <% end %>
  <%= hidden_field_tag :lang, params[:lang] unless params[:lang].nil? %>
  <%= hidden_field_tag :obj_id, '' %>
  <br/><br/>
  <%= f.submit t('save_changes', default: "Save Changes"), class: 'btn btn-warning' %>
